﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace YArchitech.Revit
{
	public class XYZEquality : IEqualityComparer<XYZ>
	{
		public bool Equals(XYZ xyz1, XYZ xyz2)
		{
			return xyz1.IsAlmostEqualTo(xyz2, RevitElementExtension.PointEqualTol);
		}

		public int GetHashCode(XYZ obj)
		{
			if (obj != null)
			{
				return obj.ToString().GetHashCode();
			}
			return 0;
		}
	}
}
